<?php
namespace app\common\entity;
use think\Http;
use think\Response;

/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/9/29 0029
 * Time: 10:52
 */
class BackResult{
    private static $data = ["msg"=>"","data"=>"","code"=>""];

    public static function success($data=[],$msg="操作成功"){
        self::$data['data'] = $data;
        self::$data['msg'] = $msg;
        self::$data["code"] = 1;
        return Response::create(self::$data,'json',200);
    }

    //用511 表示未登录
    public static function error($data=[],$msg="操作失败"){
        self::$data['data'] = $data;
        self::$data['msg'] = $msg;
        self::$data["code"] = 0;
        return Response::create(self::$data,'json',200);
    }

}